#define max(a, b) ((a)>(b))?(a):(b)

void monocromatizar_inf_c(unsigned char *src,unsigned char *dst, int h, int w, int src_row_size, int dst_row_size) {

	int desplazamiento_src = src_row_size - 3*w;
	int desplazamiento_dst = dst_row_size - w;
	
	int fila = 0;
	int columna = 0;
	for(fila = 0; fila < h; fila++)
	{
		for(columna = 0; columna < w; columna++)
		{
			*dst = max(src[0], max(src[1], src[2]));
			src += 3;
			dst++;
		}
		dst += desplazamiento_dst;
		src += desplazamiento_src;
	}
}

